package com.example.pdfdemo

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import com.lmoumou.lib_pdfload.WebViewHelper
import com.lmoumou.lib_pdfload.view.ProgressListener
import kotlinx.android.synthetic.main.activity_coustom.*

/**
 * @author Lmoumou
 * @date : 2019/8/27 15:33
 */
class CoustomActivity : AppCompatActivity() {

    companion object {
        fun startThis(context: Context) {
            context.startActivity(Intent(context.applicationContext, CoustomActivity::class.java))
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_coustom)

        WebViewHelper.webViewSetting(mWebView, object : ProgressListener {
            override fun LoadProgress(progress: Int) {
                //对加载进度的监听
                Log.e("CoustomActivity", "LoadProgress: $progress")
            }
        })

        WebViewHelper.webViewLoadPDF(
            mWebView,
            "https://puboss.chengdumaixun.com/article/para/589b84b3-d630-4adb-87cb-4304406d56e9.pdf"
        )
    }
}